SNOW_Picture ="" ;
var test = [];
test[0]=0;
test[1]=0;
test[2]=0;
$(document).ready(function(){
	$( "body" ).append( "<span id=\"konamievent\"></span>" );
	$(".konami").each(function(){
		$(this).hide("fast");	
	});
});
		
document.addEventListener('keydown', function(event) {	
	if (((test[0] == 0) && event.keyCode == (64+3)) //c
	|| ((test[0] == 1) && event.keyCode == (64+8)) //h
	|| ((test[0] == 2) && event.keyCode == (64+18)) //r
	|| ((test[0] == 3) && event.keyCode == (64+9)) //i
	|| ((test[0] == 4) && event.keyCode == (64+19)) //s
	|| ((test[0] == 5) && event.keyCode == (64+20)) //t
	|| ((test[0] == 6) && event.keyCode == (64+13)) //m
	|| ((test[0] == 7) && event.keyCode == (64+1))) { // a
		test[0]=test[0]+1;	 				 
		 } 
	else if (test[0] == 8 && event.keyCode == (64+19)) { // s		
		 $(".konami").each(function(){
			 $(this).find("img").attr("src","images/snow.png");
			 if($(this).is(":visible") )
				 $(this).hide("fast");			 	
			 else
				 $(this).show("fast");
			 
			
		 });
		}
	else{
		 test[0] = 0 ;
		}
	

	if (((test[1] == 0) && event.keyCode == (64+8)) //h
			|| ((test[1] == 1) && event.keyCode == (64+1)) //a
			|| ((test[1] == 2) && event.keyCode == (64+12)) //l
			|| ((test[1] == 3) && event.keyCode == (64+12)) //l
			|| ((test[1] == 4) && event.keyCode == (64+15)) //o
			|| ((test[1] == 5) && event.keyCode == (64+23)) //w
			|| ((test[1] == 6) && event.keyCode == (64+5)) //e
			|| ((test[1] == 7) && event.keyCode == (64+5))) { // e
				test[1]=test[1]+1;	 				 
				 } 
			else if (test[1] == 8 && event.keyCode == (64+14)) { // n
				 $(".konami").each(function(){
					 $(this).find("img").attr("src","images/ghost2.png");
					 if($(this).is(":visible") )
						 $(this).hide("fast");			 	
					 else
						 $(this).show("fast");
				 });
				}
			else{
				 test[1] = 0 ;
				}
	if (((test[2] == 0) && event.keyCode == (64+13)) //m
			|| ((test[2] == 1) && event.keyCode == (64+9)) //i
			|| ((test[2] == 2) && event.keyCode == (64+14)) //n
			|| ((test[2] == 3) && event.keyCode == (64+9)) //i
			|| ((test[2] == 4) && event.keyCode == (64+20)) //t
			|| ((test[2] == 5) && event.keyCode == (64+5))) { // e
				test[2]=test[2]+1;	 				 
				 } 
			else if (test[2] == 6 && event.keyCode == (64+12)) { // l
				$('link[rel="stylesheet"]').each(function(){
					 if(!($(this).attr('disabled')== 'disabled') ){						
						 $(this).attr('disabled', 'disabled');		
						 $("iframe, img").each(function(){
							 $(this).hide("fast");
						 });
						 $("body").css( "background-color","#000000");
						 $("body").css( "color","#ffffff");
						 $('a').css('color', '#ff0000');
						 $("body").css("font-family","Lucida Console");						 
						 
					 }
					 else{
						 $("body").css( "background-color","");
						 $("body").css( "color","");
						 $('a').css('color', '');
						 $("body").css("font-family","");	
						 $("iframe, img").each(function(){
							 $(this).show("fast");
						 });
						 $(this).removeAttr('disabled');
					 }
				});
				}
			else{
				 test[2] = 0 ;
				}
	
});


////////////////////////////////////////////////////////////////
//Javascript made by Rasmus - http://www.peters1.dk //  
////////////////////////////////////////////////////////////////

var SNOW_no = 15;  

var SNOW_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;  
var SNOW_browser_MOZ = (self.innerWidth) ? 1 : 0;  
var SNOW_browser_IE7 = (document.documentElement.clientHeight) ? 1 : 0;  

var SNOW_Time;  
var SNOW_dx, SNOW_xp, SNOW_yp;  
var SNOW_am, SNOW_stx, SNOW_sty;   
var i, SNOW_Browser_Width, SNOW_Browser_Height;  

if (SNOW_browser_IE_NS)  
{  
 SNOW_Browser_Width = document.body.clientWidth;  
 SNOW_Browser_Height = document.body.clientHeight;  
}  
else if (SNOW_browser_MOZ)  
{  
 SNOW_Browser_Width = self.innerWidth - 20;  
 SNOW_Browser_Height = self.innerHeight;  
}  
else if (SNOW_browser_IE7)  
{  
 SNOW_Browser_Width = document.documentElement.clientWidth;  
 SNOW_Browser_Height = document.documentElement.clientHeight;  
}  

SNOW_dx = new Array();  
SNOW_xp = new Array();  
SNOW_yp = new Array();  
SNOW_am = new Array();  
SNOW_stx = new Array();  
SNOW_sty = new Array();  

for (i = 0; i < SNOW_no; ++ i)   
{   
 SNOW_dx[i] = 0;   
 SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-50);  
 SNOW_yp[i] = Math.random()*SNOW_Browser_Height;  
 SNOW_am[i] = Math.random()*20;   
 SNOW_stx[i] = 0.02 + Math.random()/10;  
 SNOW_sty[i] = 0.7 + Math.random();  
 if (i == 0) document.write("<\div class=\"konami konamievent\" id=\"SNOW_flake"+ i +"\" style=\"opacity: 0.4;position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><a href=\"http://www.peters1.dk\" target=\"_blank\"><\img src=\""+SNOW_Picture+"\" width=\"30\" height=\"30\" border=\"0\"></a><\/div>");  
 else document.write("<\div class=\"konami konamievent\" id=\"SNOW_flake"+ i +"\" style=\"opacity: 0.4;position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+SNOW_Picture+"\" width=\"30\" height=\"30\" border=\"0\"><\/div>");  
}  

function SNOW_Weather()   
{   

for (i = 0; i < SNOW_no; ++ i)   
{   
 SNOW_yp[i] += SNOW_sty[i];  

 if (SNOW_yp[i] > SNOW_Browser_Height-50)   
 {  
     SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-SNOW_am[i]-30);  
     SNOW_yp[i] = 0;  
     SNOW_stx[i] = 0.02 + Math.random()/10;  
     SNOW_sty[i] = 0.7 + Math.random();  
 }  

 SNOW_dx[i] += SNOW_stx[i];  

 document.getElementById("SNOW_flake"+i).style.top=SNOW_yp[i]+"px";  
 document.getElementById("SNOW_flake"+i).style.left=SNOW_xp[i] + SNOW_am[i]*Math.sin(SNOW_dx[i])+"px";  
}  

SNOW_Time = setTimeout("SNOW_Weather()", 10);  

}  

SNOW_Weather();  






